home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
59454
/
59454.xpi
/
content
/
Preference.js
< prev
next >
Wrap
Text File
|
2010-01-26
|
2KB
|
66 lines
BartUniversalSearch.Preference = BartUtils.defineClass(
{
name: "UniversalSearchPreference",
statics:
{
init: function()
{
BartUniversalSearch.Preference.prefService = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
},
_getBoolPref: function(name, defaultValue)
{
var value = BartUniversalSearch.Preference.prefService.getBoolPref(name);
if(value == undefined || value == null)
value = defaultValue;
return value;
},
_getIntPref: function(name, defaultValue)
{
var value = BartUniversalSearch.Preference.prefService.getIntPref(name);
if(value == undefined || value == null)
value = defaultValue;
return value;
},
_getCharPref: function(name, defaultValue)
{
var value = BartUniversalSearch.Preference.prefService.getCharPref(name);
if(value == undefined || value == null)
value = defaultValue;
return value;
},
showCopyButton: function()
{
return BartUniversalSearch.Preference._getBoolPref("extensions.UniversalSearch.showCopyButton", true);
},
showHighlightButton: function()
{
return BartUniversalSearch.Preference._getBoolPref("extensions.UniversalSearch.showHighlightButton", false);
},
getNewTabType: function()
{
return BartUniversalSearch.Preference._getIntPref("extensions.UniversalSearch.openNewTabType", 1);
},
getDefaultEngine: function()
{
return BartUniversalSearch.Preference._getCharPref("extensions.UniversalSearch.defaultEngine", "Google");
},
setDefaultEngine: function(engineName)
{
BartUniversalSearch.Preference.prefService.setCharPref("extensions.UniversalSearch.defaultEngine", engineName);
}
}
});